package com.deke.home.service.impl;

import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.deke.entity.TbArticle;
import com.deke.home.dao.QianArticleDao;
import com.deke.home.service.QianArticleService;
import com.deke.vo.Result;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

/**
 * @author ：ludi（206913808@qq.com）
 * @date ：Created in 2022/12/23 18:24
 * @description：
 * @modified By：
 * @version:
 */
@Service
public class QianArticleServiceImpl implements QianArticleService {
    @Autowired
    private QianArticleDao qianArticleDao;


    /**
     * @create by: ludi（206913808@qq.com）
     * @description: 底部文章跳转
     * @create time: 2022/12/23 18:24
     * @param id
     * @return com.deke.vo.Result
     */
    @Override
    public Result getAllQianArticle(String id) {
        QueryWrapper<TbArticle> wrapper = new QueryWrapper<>();
        wrapper.eq("nav_id", id);
        TbArticle tbArticle = qianArticleDao.selectOne(wrapper);
        return new Result(2000, "查询成功", tbArticle);
    }
}